home *** CD-ROM | disk | FTP | other *** search
- now = new Date();
- day = now.getDate();
- if(length(day) < 2)
- {
- clock.theDate.d1.gotoAndStop(1);
- clock.theDate.d2.gotoAndStop(day + 1);
- }
- else
- {
- clock.theDate.d1.gotoAndStop(int(day.substr(1,1)) + 1);
- clock.theDate.d2.gotoAndStop(int(day.substr(2,1)) + 1);
- }
- month = now.getMonth();
- if(length(month) < 2)
- {
- clock.theDate.mo1.gotoAndStop(1);
- clock.theDate.mo2.gotoAndStop(month + 2);
- }
- else
- {
- clock.theDate.mo1.gotoAndStop(int(month.substr(1,1)) + 2);
- clock.theDate.mo2.gotoAndStop(int(month.substr(2,1)) + 2);
- }
- year = now.getYear() - 100;
- if(length(year) < 2)
- {
- clock.theDate.y1.gotoAndStop(1);
- clock.theDate.y2.gotoAndStop(year + 1);
- }
- else
- {
- clock.theDate.y1.gotoAndStop(int(year.substr(1,1)) + 1);
- clock.theDate.y2.gotoAndStop(int(year.substr(2,1)) + 1);
- }
- hour = now.getHours();
- if(hour < 12)
- {
- clock.am.gotoAndStop(2);
- clock.pm.gotoAndStop(1);
- }
- else
- {
- clock.am.gotoAndStop(1);
- clock.pm.gotoAndStop(2);
- }
- if(12 < hour)
- {
- hour -= 12;
- }
- if(length(hour) < 2)
- {
- clock.theTime.h1.gotoAndStop(1);
- clock.theTime.h2.gotoAndStop(hour + 1);
- }
- else
- {
- clock.theTime.h1.gotoAndStop(int(hour.substr(1,1)) + 1);
- clock.theTime.h2.gotoAndStop(int(hour.substr(2,1)) + 1);
- }
- minutes = now.getMinutes();
- if(length(minutes) < 2)
- {
- clock.theTime.mi1.gotoAndStop(1);
- clock.theTime.mi2.gotoAndStop(minutes + 1);
- }
- else
- {
- clock.theTime.mi1.gotoAndStop(int(minutes.substr(1,1)) + 1);
- clock.theTime.mi2.gotoAndStop(int(minutes.substr(2,1)) + 1);
- }
- seconds = now.getSeconds();
- if(seconds == 0)
- {
- clock.theTime.s1.gotoAndStop(1);
- clock.theTime.s2.gotoAndStop(1);
- }
- else if(length(seconds) < 2)
- {
- clock.theTime.s1.gotoAndStop(1);
- clock.theTime.s2.gotoAndStop(seconds + 1);
- }
- else
- {
- clock.theTime.s1.gotoAndStop(int(seconds.substr(1,1)) + 1);
- clock.theTime.s2.gotoAndStop(int(seconds.substr(2,1)) + 1);
- }
-